package com.jinmdz.fmis.api.model.menu;

import com.jinmdz.fmis.common.ext.ArrayListExt;

/**
 * 测试菜单信息
 *
 * @author LiCongLu
 * @date 2020-03-31 15:23
 */
public class MenuInfo {

    /**
     * 菜单名称
     */
    private String menuName;

    /**
     * 菜单路由
     */
    private String menuRoute;

    /**
     * 菜单重定向路由
     */
    private String menuRedirectRoute;

    /**
     * 菜单图标，element-ui中样式名称
     */
    private String menuIcon;

    /**
     * 子菜单
     */
    private ArrayListExt<MenuInfo> children;

    /**
     * 按钮
     */
    private ArrayListExt<ButtonInfo> buttons;

    public MenuInfo() {
    }

    public MenuInfo(String menuName, String menuRoute, String menuIcon) {
        this.menuName = menuName;
        this.menuRoute = menuRoute;
        this.menuIcon = menuIcon;
    }

    public MenuInfo(String menuName, String menuRoute, String menuRedirectRoute, String menuIcon) {
        this.menuName = menuName;
        this.menuRoute = menuRoute;
        this.menuRedirectRoute = menuRedirectRoute;
        this.menuIcon = menuIcon;
    }

    public String getMenuName() {
        return menuName;
    }

    public MenuInfo setMenuName(String menuName) {
        this.menuName = menuName;
        return this;
    }

    public String getMenuRoute() {
        return menuRoute;
    }

    public MenuInfo setMenuRoute(String menuRoute) {
        this.menuRoute = menuRoute;
        return this;
    }

    public String getMenuRedirectRoute() {
        return menuRedirectRoute;
    }

    public MenuInfo setMenuRedirectRoute(String menuRedirectRoute) {
        this.menuRedirectRoute = menuRedirectRoute;
        return this;
    }

    public String getMenuIcon() {
        return menuIcon;
    }

    public MenuInfo setMenuIcon(String menuIcon) {
        this.menuIcon = menuIcon;
        return this;
    }

    public ArrayListExt<MenuInfo> getChildren() {
        return children;
    }

    public MenuInfo setChildren(ArrayListExt<MenuInfo> children) {
        this.children = children;
        return this;
    }

    public ArrayListExt<ButtonInfo> getButtons() {
        return buttons;
    }

    public MenuInfo setButtons(ArrayListExt<ButtonInfo> buttons) {
        this.buttons = buttons;
        return this;
    }

    /**
     * 追加子菜单
     *
     * @param args
     * @return
     */
    public MenuInfo children(MenuInfo... args) {
        if (children == null) {
            children = new ArrayListExt<>();
        }
        children.addExt(args);
        return this;
    }

    /**
     * 追加按钮
     *
     * @param args
     * @return
     */
    public MenuInfo buttons(ButtonInfo... args) {
        if (buttons == null) {
            buttons = new ArrayListExt<>();
        }
        buttons.addExt(args);
        return this;
    }
}
